package com.dss.code_generation.controller;

import com.dss.code_generation.util.IpUtil;
import com.dss.code_generation.util.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
* 虚拟机服务器
* @Description:虚拟机服务器控制层
* @author dongshoushan
* @date 2022-09-06 15:29:28
*/
@RestController
@RequestMapping("/server")
@RequiredArgsConstructor(onConstructor = @_(@Autowired))
@Api(tags ="99: 虚拟机服务器")
public class ServerController {

    @Value("${server.port}")
    private String port;
    @GetMapping("/getLocalIp")
    @ApiOperation(value = "获取本机ip", notes="获取本机ip")
    public Result getLocalIp(){
        return Result.success(IpUtil.getLocalIp()+":"+port);
    }

}
